﻿
@{
    ViewBag.Title = "AnalysisPage";
    Layout = "~/Views/Shared/_LayoutMain.cshtml";
}
@section css {
    <link href="~/Assets/css/lib/bootstrap-select.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/bootstrap-datetimepicker.min.css" rel="stylesheet" />
    <link href="~/Assets/css/lib/fileinput.css" rel="stylesheet" />
}
<div class="page-content" ng-cloak ng-controller="CalcAnalysisController" ng-init="
      IssueTypeModel={};
     IssueTypeModel.Year='@DateTime.Now.Year.ToString()';
       IssueParkModel={};
     IssueParkModel.Year='@DateTime.Now.Year.ToString()';
     GetCheckYearList();
        GetCheckNum();
     CheckModel.Type=0;
     CheckModel.Year='@DateTime.Now.Year.ToString()';
     GetCheckCountView(CheckModel);
     GetMonthlyCheckChart(CheckModel);

     GetCategoryView(IssueTypeModel);
     GetParkView(IssueTypeModel);
     GetLevelView(IssueTypeModel);
     GetPlaceCountByType();
     GetPlaceCountByPark();
     GetDeviceCountByType();
     ">
    <div class="page-heading">
        <h1>统计分析</h1>
        <div class="options">
            <div class="btn-toolbar">

            </div>
        </div>
    </div>
    <ol class="breadcrumb">
        <li><a>主页</a></li>
        <li class="active"><a>统计分析</a></li>
    </ol>
    <div class="row">
        <div class="col-md-3">
            <a class="info-tiles tiles-inverse has-footer" href="#">
                <div class="tiles-heading">
                    <div class="pull-left">检查台账</div>
                    <div class="pull-right">
                        <div id="tileorders" class="sparkline-block"><canvas width="39" height="13" style="display: inline-block; width: 39px; height: 13px; vertical-align: top;"></canvas></div>
                    </div>
                </div>
                <div class="tiles-body">
                    <div class="text-center" ng-bind="CheckCount.Total">0</div>
                </div>
                <div class="tiles-footer">
                    <div class="pull-left">本周新增</div>
                    <div class="pull-right percent-change">+{{CheckCount.ThisWeek}}</div>
                </div>
            </a>
        </div>
        <div class="col-md-3">
            <a class="info-tiles tiles-orange has-footer" href="#">
                <div class="tiles-heading">
                    <div class="pull-left">异常数量</div>
                    <div class="pull-right">
                        <div id="tilerevenues" class="sparkline-block"><canvas width="40" height="13" style="display: inline-block; width: 40px; height: 13px; vertical-align: top;"></canvas></div>
                    </div>
                </div>
                <div class="tiles-body">
                    <div class="text-center" ng-bind="CheckCount.TotalException">0</div>
                </div>
                <div class="tiles-footer">
                    <div class="pull-left">本周新增</div>
                    <div class="pull-right percent-change">+{{CheckCount.ThisWeekCount}}</div>
                </div>
            </a>
        </div>
        <div class="col-md-3">
            <a class="info-tiles tiles-blue has-footer" href="#">
                <div class="tiles-heading">
                    <div class="pull-left">问题台账</div>
                    <div class="pull-right">
                        <div id="tiletickets" class="sparkline-block"><canvas width="13" height="13" style="display: inline-block; width: 13px; height: 13px; vertical-align: top;"></canvas></div>
                    </div>
                </div>
                <div class="tiles-body">
                    <div class="text-center" ng-bind="IssueCount.Total">0</div>
                </div>
                <div class="tiles-footer">
                    <div class="pull-left">本周增长</div>
                    <div class="pull-right percent-change" ng-bind="IssueCount.ThisWeek">0</div>
                </div>
            </a>
        </div>

        <div class="col-md-3">
            <a class="info-tiles tiles-midnightblue has-footer" href="#">
                <div class="tiles-heading">
                    <div class="pull-left">整改完成</div>
                    <div class="pull-right">
                        <div id="tilemembers" class="sparkline-block"><canvas width="39" height="13" style="display: inline-block; width: 39px; height: 13px; vertical-align: top;"></canvas></div>
                    </div>
                </div>
                <div class="tiles-body">
                    <div class="text-center" ng-bind="IssueCount.Complelte">0</div>
                </div>
                <div class="tiles-footer">
                    <div class="pull-left">整改中</div>
                    <div class="pull-right percent-change" ng-bind="IssueCount.Ret">0</div>
                </div>
            </a>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12 bs-grid">
            <div class="panel panel-default panel-btn-focused" id="p1" data-widget-editbutton="false">
                <div class="panel-heading">
                    <h2>
                        <ul class="nav nav-tabs">
                            <li ng-click="CheckModel.Type=0;GetCheckCountView(CheckModel);" class="active"><a href="#tab-visitor" data-toggle="tab"><i class="fa fa-user visible-xs"></i><span class="hidden-xs">场所分布态势</span></a></li>
                            @*<li ng-click="CheckModel.Type=2;GetCheckCountView(CheckModel);"><a href="#tab-revenues" data-toggle="tab"><i class="fa fa-bar-chart-o visible-xs"></i><span class="hidden-xs">月份分布态势</span></a></li>*@
                        </ul>
                    </h2>
                    <div class="panel-ctrls">
                        <div class="col-lg-6">
                            <select ng-model="CheckModel.Year" ng-change="GetCheckCountView(CheckModel);" class="form-control" style="margin-top:10px;">
                                <option ng-repeat="x in CheckYearList" value="{{x}}" selected>{{x}}</option>
                            </select>
                        </div>
                        <div class="col-lg-6">
                            <select ng-model="CheckModel.Month" ng-change="GetCheckCountView(CheckModel);" class="form-control" style="margin-top: 10px;">
                                <option selected value="">全部</option>
                                <option value="01">1</option>
                                <option value="02">2</option>
                                <option value="03">3</option>
                                <option value="04">4</option>
                                <option value="05">5</option>
                                <option value="06">6</option>
                                <option value="07">7</option>
                                <option value="08">8</option>
                                <option value="09">9</option>
                                <option value="10">10</option>
                                <option value="11">11</option>
                                <option value="12">12</option>
                            </select>
                        </div>

                    </div>
                </div>

                <div class="panel-body">
                    <div class="row">
                        <div class="col-lg-1">
                            <div ng-show="CheckModel.Type==0">
                                <select class="selectpicker show-tick form-control PlaceType_Select" ng-model="CheckModel.PlaceType" ng-change="GetPlaceCheckChart(CheckModel);" multiple>
                                    <option value="1">危险点</option>
                                    <option value="2">重要部位</option>
                                    <option value="3">办公场所</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-lg-12">
                            <div class="tab-content" id="countview">

                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h2>近30日检查台账提交情况</h2>
                    <div class="panel-ctrls">

                    </div>
                </div>
                <div class="panel-body">
                    <div class="row">
                        <div class="col-lg-1">
                            <div>
                                <select class="selectpicker show-tick form-control PlaceType_Select" ng-model="CheckModel.PlaceType2" ng-change="GetMonthlyCheckChart(CheckModel);" multiple>
                                    <option value="1">危险点</option>
                                    <option value="2">重要部位</option>
                                    <option value="3">办公场所</option>
                                </select>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-lg-12">
                            <div id="checkrecordmonthlyview" style="width:100%; height: 300px" class="centered"></div>

                        </div>

                    </div>

                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-4">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h2>问题类型分布</h2>
                    <div class="panel-ctrls">

                        <select class="form-control" ng-model="IssueTypeModel.Year" ng-change="GetCategoryView(IssueTypeModel);" style="margin-top:10px;">
                            <option ng-repeat="x in CheckYearList" value="{{x}}" selected>{{x}}</option>
                        </select>

                    </div>
                </div>
                <div class="panel-body">
                    <div id="typeview" style="width:100%; height: 300px" class="centered"></div>
                </div>
            </div>
        </div>
        <div class="col-md-4">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h2>问题所在园区分布</h2>
                    <div class="panel-ctrls">
                        <select class="form-control" ng-model="IssueParkModel.Year" ng-change="GetParkView(IssueParkModel);" style="margin-top:10px;">
                            <option ng-repeat="x in CheckYearList" value="{{x}}" selected>{{x}}</option>
                        </select>
                    </div>
                </div>
                <div class="panel-body">
                    <div id="factoryview" style="width:100%; height: 300px" class="centered"></div>
                </div>
            </div>
        </div>

        <div class="col-md-4">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h2>问题等级分布</h2>
                    <div class="panel-ctrls">
                        <div class="col-lg-12">
                            <select class="form-control" style="margin-top:10px;" ng-model="IssueLevelModel.Year" ng-change="GetLevelView(IssueLevelModel);">
                                <option ng-repeat="x in CheckYearList" value="{{x}}" selected>{{x}}</option>
                            </select>
                        </div>

                    </div>
                </div>
                <div class="panel-body">
                    <div id="souceview" style="width:100%; height: 300px" class="centered"></div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">

        <div class="col-md-4">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h2>各场所类型数量占比</h2>
                    <div class="panel-ctrls">

                    </div>
                </div>
                <div class="panel-body">
                    <div id="placetypeview" style="width:100%; height: 300px" class="centered"></div>
                </div>
            </div>
        </div>
        <div class="col-md-4">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h2>各园区场所数量占比</h2>
                    <div class="panel-ctrls">

                    </div>
                </div>
                <div class="panel-body">
                    <div id="parkplaceview" style="width:100%; height: 300px" class="centered"></div>
                </div>
            </div>
        </div>
        <div class="col-md-4">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h2>设备类型数量</h2>
                    <div class="panel-ctrls">

                    </div>
                </div>
                <div class="panel-body">
                    <div id="devicetypeview" style="width:100%; height: 300px" class="centered"></div>
                </div>
            </div>
        </div>
    </div>
</div>


@section Js{
    <script src="~/Assets/js/base/echart.min.js"></script>
    <script src="~/Assets/js/pg/CalcAnalysis.js?v=@DateTime.Now.ToString("yyyyMMddHHmm")"></script>
    <script>
        $(".PlaceType_Select").selectpicker({
            noneSelectedText: '所有类型场所'//默认显示内容
        });
       

      
    </script>
}

